package com.lazy.lib.sys;

import java.time.ZoneId;

public class SysContants {
    /**北京时区*/
    public static final ZoneId ZONE_ID_CN = ZoneId.of("GMT+08:00");
    
    /**操作成功*/
    public static final int RETURN_SUCCESS = 0x00000001;
    public static final String RETURN_SUCCESS_STR = "操作成功";
    
    /**操作失败*/
    public static final int RETURN_FAILURE = 0x00000000;
    
    /**登录超时：0xFFFFFC19 （-999）*/
    public static final int RETCODE_LOGIN_TIMEOUT = 0xFFFFFC19;
    
    /**没有权限：0x0000000A （10）*/
    public static final int RETCODE_NO_PERMISSION = 0x0000000A;

    /**数据在其他表有外键约束导致删除异常：0x00001001*/
    public static final int FAIL_DELETE_FOR_FOREIGN_REF = 0x00001001;
    
    /**数据记录不存在：0x00001002*/
    public static final int DATA_NOT_EXIST = 0x00001002;
    
    /**数据重复(唯一性索引字段值)：0x00001003*/
    public static final int DATA_DUPLICUTE = 0x00001003;
    
    /**返回码：协议参数错误：0x00002001*/
    public static final int RET_CODE_PROTOCOL_ERROR = 0x00002001;
    
	   public static enum OperType{
        unknow("未知", "_UNKNOW"),
        add("创建", "_ADD"),
        modify("修改", "_MOD"),
        delete("删除", "_DEL"), 
        query("查询", "_QUERY");
        
        private OperType(String label, String value){
            this.value = value;
            this.label = label;
        }
        
        private String value;
        private String label;
        
        public String getValue(){
            return this.value;
        }
        
        public String toString() {
            return this.label;
        }
    }
    
    public static enum OperResult{
        successful("成功", (short)1), 
        failure("失败", (short)0);
        
        private OperResult(String label, short value){
            this.value = value;
            this.label = label;
        }
        
        private short value;
        private String label;
        
        public short getValue(){
            return this.value;
        }
        
        public String toString() {
            return this.label;
        }
    }
	
	   protected SysContants() {
	   }
}
